﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace GuanYijia.EntityFarmeworkCore.Migrations
{
    public partial class log2 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "PurchaseOrders",
                columns: table => new
                {
                    purchaseorderid = table.Column<int>(type: "int", nullable: false)
                        .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
                    SupplierId = table.Column<int>(type: "int", nullable: true),
                    document_number = table.Column<string>(type: "varchar(20)", maxLength: 20, nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    productid = table.Column<int>(type: "int", nullable: true),
                    document_date = table.Column<DateTime>(type: "datetime(6)", nullable: true),
                    userId = table.Column<int>(type: "int", nullable: true),
                    quantity = table.Column<int>(type: "int", nullable: true),
                    purchase_decimal = table.Column<decimal>(type: "decimal(65,30)", nullable: true),
                    sumprice = table.Column<decimal>(type: "decimal(65,30)", nullable: true),
                    tax_rate = table.Column<decimal>(type: "decimal(65,30)", nullable: true),
                    tax_money = table.Column<decimal>(type: "decimal(65,30)", nullable: true),
                    tax_last_money = table.Column<decimal>(type: "decimal(65,30)", nullable: true),
                    discount = table.Column<decimal>(type: "decimal(65,30)", nullable: true),
                    discount_money = table.Column<decimal>(type: "decimal(65,30)", nullable: true),
                    discount_last_money = table.Column<decimal>(type: "decimal(65,30)", nullable: true),
                    AccountId = table.Column<int>(type: "int", nullable: true),
                    deposit = table.Column<decimal>(type: "decimal(65,30)", nullable: true),
                    annex = table.Column<string>(type: "longtext", nullable: true)
                        .Annotation("MySql:CharSet", "utf8mb4"),
                    IsDel = table.Column<bool>(type: "tinyint(1)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_PurchaseOrders", x => x.purchaseorderid);
                })
                .Annotation("MySql:CharSet", "utf8mb4");
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "PurchaseOrders");
        }
    }
}
